package com.gdwstudy.enum_;

/**
 * @author 关道伟
 * @version 1.0
 * 关键字实现枚举
 */
public class Enum02 {
    public static void main(String[] args) {
        System.out.println(Season02.SPRING);
    }
}

enum Season02{
    //如果是多个则用逗号分割
    //如果使用的是无参构造器 则可以省略（）
    //枚举对象必须放在最前面
    SPRING("春天","温暖"),WINTER("冬天","寒冷");

    //属性按照构造器的顺序定义在枚举常量的后面
    private String name;
    private String Desc;

    private Season02(String name, String desc) {
        this.name = name;
        Desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return Desc;
    }

    @Override
    public String toString() {
        return "Season02{" +
                "name='" + name + '\'' +
                ", Desc='" + Desc + '\'' +
                '}';
    }
}